package com.buba.springcloud.controller;


import com.buba.springcloud.entities.CommonResult;
import com.buba.springcloud.entities.HfOrders;
import com.buba.springcloud.service.HfOrederService;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@Slf4j
@RequestMapping("/backstagesupporter/orde")
public class HfOrderController {
    @Resource
    private HfOrederService orederService;

    @GetMapping(value = "/getAllOrders")
    public CommonResult getHforeders(String orderCode,String userName,String phone,Integer status){
        List<HfOrders> orders = orederService.getOrders(orderCode,userName,phone,status);
        if (orders.size()!=0){
            return new CommonResult(200,"查询成功",orders);
        }
        return new CommonResult(500,"查询失败");
    }
}
